﻿using System;
using XEvolve.Core.Runtime.Internal;

namespace XEvolve.Core.Runtime
{
    public static class Adapters
    {
        internal static AdapterManager Manager;
        public static AdapterType GetAdapter<AdapterType>(this object adaptee)
        {
            return (AdapterType) GetAdapter(adaptee, typeof(AdapterType));
        }

        public static object GetAdapter(this object adaptee, Type adapterType)
        {
            return Manager != null ? Manager.CreateAdapter(adaptee, adapterType) : null;
        }
    }
}
